home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Online / MiamiSDK / doc / MiamiPCap.doc < prev    next >
Encoding:
Text File  |  1997-12-04  |  17.5 KB  |  762 lines

  1. TABLE OF CONTENTS
  2.  
  3. -- general information --
  4. -- PCap callbacks --
  5. MiamiPCapAmigaBPFHandle
  6. MiamiPCapAmigaDump
  7. MiamiPCapAmigaDumpClose
  8. MiamiPCapAmigaDumpOpen
  9. MiamiPCapAmigaFile
  10. MiamiPCapBPFImage
  11. MiamiPCapClose
  12. MiamiPCapCompile
  13. MiamiPCapDatalink
  14. MiamiPCapDispatch
  15. MiamiPCapGeterr
  16. MiamiPCapInit
  17. MiamiPCapIsSwapped
  18. MiamiPCapLookupdev
  19. MiamiPCapLookupnet
  20. MiamiPCapLoop
  21. MiamiPCapMajorVersion
  22. MiamiPCapMinorVersion
  23. MiamiPCapNext
  24. MiamiPCapOpenLive
  25. MiamiPCapOpenOffline
  26. MiamiPCapPerror
  27. MiamiPCapSetfilter
  28. MiamiPCapSnapshot
  29. MiamiPCapStats
  30. MiamiPCapStrerror
  31. -- general information --                -- general information --
  32.  
  33.     Miami:libs/miamipcap.library is an implementation of the
  34.     libpcap software suite, a packet monitoring mechanism built on top of
  35.     BPF, which provides high-level filtering functions.
  36.  
  37.     MiamiPCap is implemented on top of MiamiBPF, which in turn uses the
  38.     packet monitoring mechanism in Miami 1.9.3 and above, i.e.  MiamiPCap
  39.     only works with the registered version of Miami.
  40.  
  41.     The main advantage of MiamiPCap over lower-level packet monitoring
  42.     mechanisms is that MiamiPCap allows an application to specify ASCII
  43.     filter strings to select a set of packets, e.g.  something like
  44.  
  45.     icmp[0] != 8 and icmp!= 0
  46.  
  47.     which would select all ICMP packets that are not echo requests or
  48.     replies.
  49.  
  50.     MiamiPCap has a built-in compiler and code optimizer to convert such
  51.     ASCII strings into the binary BPF program code sequences required by
  52.     the underlying MiamiBPF suite.
  53.  
  54.     The primary use of MiamiPCap is in programs such as TCPDump.
  55.  
  56. -- PCap callbacks --                     -- PCap callbacks --
  57.  
  58.     PCap calls a callback function in your program for each packet
  59.     received, which has not been filtered out.  The proper declaration of
  60.     the callback function is:
  61.  
  62.     void pcapcallback(void *user,struct pcap_pkthdr *pkthdr,int
  63.     packetlength);
  64.  
  65. MiamiPCapAmigaBPFHandle                   MiamiPCapAmigaBPFHandle
  66.  
  67.    NAME
  68.     MiamiPCapAmigaBPFHandle -- returns the BPF handle associated with a
  69.     pcap unit
  70.  
  71.    SYNOPSIS
  72.     bpfhandle = MiamiPCapAmigaBPFHandle( p    );
  73.     D0                     A0
  74.  
  75.     int MiamiPCapAmigaBPFHandle( pcap_t *p );
  76.  
  77.    FUNCTION
  78.     Returns the BPF handle associated with a pcap unit.
  79.  
  80.    INPUTS
  81.     p - pcap unit handle
  82.  
  83.    RESULT
  84.     bpfhandle (D0) - BPF handle
  85.  
  86. MiamiPCapAmigaDump                       MiamiPCapAmigaDump
  87.  
  88.    NAME
  89.     MiamiPCapAmigaDump -- dump a packet to a save file
  90.  
  91.    SYNOPSIS
  92.     MiamiPCapAmigaDump( filehandle, h, sp );
  93.                 A0        A1 A2
  94.  
  95.     void MiamiPCapAmigaDump( pcap_dumper_t *filehandle, struct
  96.         pcap_pkthdr *h, u_char *sp );
  97.  
  98.    FUNCTION
  99.     Dumps the packet specified in sp to the specified save file, using
  100.     the packet header passed in h.
  101.  
  102.     The file handle MUST have been created by an earlier call to
  103.     MiamiPCapAmigaDumpOpen.
  104.  
  105.    INPUTS
  106.     filehandle - file handle
  107.  
  108.     h - packet header
  109.  
  110.     sp - data
  111.  
  112. MiamiPCapAmigaDumpClose                   MiamiPCapAmigaDumpClose
  113.  
  114.    NAME
  115.     MiamiPCapAmigaDumpClose -- closes an open save file
  116.  
  117.    SYNOPSIS
  118.     MiamiPCapAmigaDumpClose( filehandle );
  119.                  A0
  120.  
  121.     void MiamiPCapAmigaDumpClose( pcap_dumper_t *filehandle );
  122.  
  123.    FUNCTION
  124.     Closes the indicated save file.
  125.  
  126.     The file must have been opened earlier by a call to
  127.     MiamiPCapAmigaDumpOpen.
  128.  
  129.    INPUTS
  130.     filehandle - file handle
  131.  
  132. MiamiPCapAmigaDumpOpen                       MiamiPCapAmigaDumpOpen
  133.  
  134.    NAME
  135.     MiamiPCapAmigaDumpOpen -- opens a save file to dump packets
  136.  
  137.    SYNOPSIS
  138.     filehandle = MiamiPCapAmigaDumpOpen( p, fname );
  139.     D0                     A0 A1
  140.  
  141.     pcap_dumper_t *MiamiPCapAmigaDumpOpen( pcap_t *p, char *fname );
  142.  
  143.    FUNCTION
  144.     Opens a save file for the specified unit.  The returned file handle
  145.     can later be used in MiamiPCapAmigaDump calls to dump packets to the
  146.     save file.
  147.  
  148.     A return value of NULL indicates that an error has occured.
  149.  
  150.     The filehandle later needs to be closed by calling
  151.     MiamiPCapAmigaDumpClose.
  152.  
  153.    INPUTS
  154.     p - pcap unit handle
  155.  
  156.     fname - file name
  157.  
  158.    RESULT
  159.     filehandle (D0) - file handle
  160.  
  161. MiamiPCapAmigaFile                       MiamiPCapAmigaFile
  162.  
  163.    NAME
  164.     MiamiPCapAmigaFile -- return Amiga file handle for save file
  165.  
  166.    SYNOPSIS
  167.     handle = MiamiPCapAmigaFile( p    );
  168.     D0                 A0
  169.  
  170.     BPTR MiamiPCapAmigaFile( pcap_t *p );
  171.  
  172.    FUNCTION
  173.     returns the Amiga file handle for the current save file.  For pOS a
  174.     (struct pOS_FileHandle *) is returned instead of a BPTR.
  175.  
  176.    INPUTS
  177.     p - pcap unit handle
  178.  
  179.    RESULT
  180.     handle (D0) - filehandle
  181.  
  182. MiamiPCapBPFImage                        MiamiPCapBPFImage
  183.  
  184.    NAME
  185.     MiamiPCapBPFImage -- disassemble a compiled BPF instruction
  186.  
  187.    SYNOPSIS
  188.     d  = MiamiPCapBPFImage( pi, n  );
  189.     D0            A0  D0
  190.  
  191.     char *MiamiPCapBPFImage( struct bpf_insn *pi, int n );
  192.  
  193.    FUNCTION
  194.     Disassembles a compiled BPF instruction into a text string.
  195.  
  196.     The two parameters are the BPF instruction and the offset (PC) of the
  197.     instruction relative to the BPF program.
  198.  
  199.     The returned string contains the disassembled text representing the
  200.     BPF instruction.  The text pointer points to static space that does
  201.     not have to be freed.  It is overwritten with the next call to
  202.     MiamiPCapBPFImage.
  203.  
  204.    INPUTS
  205.     pi - bpf instruction
  206.  
  207.     n - instruction offset (PC)
  208.  
  209.    RESULT
  210.     d (D0) - disassembled code
  211.  
  212. MiamiPCapClose                               MiamiPCapClose
  213.  
  214.    NAME
  215.     MiamiPCapClose -- closes a pcap unit
  216.  
  217.    SYNOPSIS
  218.     MiamiPCapClose( p  );
  219.             A0
  220.  
  221.     void MiamiPCapClose( pcap_t *p );
  222.  
  223.    FUNCTION
  224.     Closes a pcap unit which was previously opened by a call to
  225.     MiamiPCapOpenLive or MiamiPCapOpenOffline.
  226.  
  227.    INPUTS
  228.     p - pcap unit handle
  229.  
  230. MiamiPCapCompile                         MiamiPCapCompile
  231.  
  232.    NAME
  233.     MiamiPCapCompile -- compile a filter string into a BPF program
  234.  
  235.    SYNOPSIS
  236.     error = MiamiPCapCompile( p, program, buf, optimize, mask );
  237.     D0              A0 A1       A2   D0         D1
  238.  
  239.     int MiamiPCapCompile( pcap_t *p, struct bpf_program *program, char
  240.         *buf, int optimize, bpf_u_int32 mask );
  241.  
  242.    FUNCTION
  243.     Compiles the filter string passed in 'buf' into a BPF program.    The
  244.     resulting program is stored in the structure passed in 'program'.
  245.  
  246.     If 'optimize' is different from zero then the BPF code optimizer is
  247.     executed on the resulting program to compress the code.  'optimize'
  248.     should always be used except if you suspect a bug in the optimizer.
  249.  
  250.     'mask' is the netmask for the interface the program is supposed to
  251.     execute on.
  252.  
  253.     The function returns zero on success and a non-zero value on failure.
  254.  
  255.    INPUTS
  256.     p - pcap unit handle
  257.  
  258.     program - BPF program structure
  259.  
  260.     buf - filter string
  261.  
  262.     optimize - optimize flag
  263.  
  264.     mask - netmask
  265.  
  266.    RESULT
  267.     error (D0) - error code
  268.  
  269. MiamiPCapDatalink                        MiamiPCapDatalink
  270.  
  271.    NAME
  272.     MiamiPCapDatalink -- return the datalink layer packet type
  273.  
  274.    SYNOPSIS
  275.     type = MiamiPCapDatalink( p  );
  276.     D0              A0
  277.  
  278.     int MiamiPCapDatalink( pcap_t *p );
  279.  
  280.    FUNCTION
  281.     returns the datalink layer packet type, i.e.  one of the DLT_...
  282.     constants in <net/bpf.h>.  For MiamiBPF the only possible value is
  283.     currently DLT_MIAMI.
  284.  
  285.    INPUTS
  286.     p - pcap unit handle
  287.  
  288.    RESULT
  289.     type (D0) - type
  290.  
  291. MiamiPCapDispatch                        MiamiPCapDispatch
  292.  
  293.    NAME
  294.     MiamiPCapDispatch -- collect and process packets
  295.  
  296.    SYNOPSIS
  297.     count = MiamiPCapDispatch( p, cnt, callback, user );
  298.     D0               A0 D0   A1         A2
  299.  
  300.     int MiamiPCapDispatch( pcap_t *p, int cnt, pcap_handler callback,
  301.         u_char *user );
  302.  
  303.    FUNCTION
  304.     Collect and process packets for the specified pcap unit.
  305.  
  306.     cnt specifies the maximum number of packets to process before
  307.     returning.  A cnt of -1 processes all the packets received in one
  308.     buffer.  A cnt of 0 processes all packets until an error occurs (or
  309.     EOF is reached for a save file).
  310.  
  311.     callback specifies a PCap callback functions, as explained in -- PCap
  312.     callbacks --.  The parameter 'user' is the user parameter for the
  313.     callback function.
  314.  
  315.     The returned value contains the number of packets read.  0 is
  316.     returned if EOF is reached in a save file.  -1 is returned to
  317.     indicate an error.
  318.  
  319.    INPUTS
  320.     p - pcap unit handle
  321.  
  322.     cnt - maximum number of packets
  323.  
  324.     callback - packet callback
  325.  
  326.     user - user data for callback
  327.  
  328.    RESULT
  329.     count (D0) - packet count
  330.  
  331. MiamiPCapGeterr                           MiamiPCapGeterr
  332.  
  333.    NAME
  334.     MiamiPCapGeterr -- returns the current error string buffer
  335.  
  336.    SYNOPSIS
  337.     errbuf = MiamiPCapGeterr( p  );
  338.     D0              A0
  339.  
  340.     char *MiamiPCapGeterr( pcap_t *p );
  341.  
  342.    FUNCTION
  343.     Returns a pointer to the current error string buffer, i.e.  the ebuf
  344.     parameter for the MiamiPCapOpenLive or MiamiPCapOpenOffline call
  345.  
  346.    INPUTS
  347.     p - pcap unit handle
  348.  
  349.    RESULT
  350.     errbuf (D0) - error buffer
  351.  
  352. MiamiPCapInit                            MiamiPCapInit
  353.  
  354.    NAME
  355.     MiamiPCapInit -- initialize MiamiPCap
  356.  
  357.    SYNOPSIS
  358.     MiamiPCapInit( MiamiBase, SocketBase );
  359.                A0      A0
  360.  
  361.     void MiamiPCapInit( struct Library *MiamiBase, struct Library
  362.         *SocketBase );
  363.  
  364.    FUNCTION
  365.     Initializes MiamiPCap for use.    You MUST call this function before
  366.     calling any other function in miamipcap.library.
  367.  
  368.    INPUTS
  369.     MiamiBase - Library base of miami.library
  370.  
  371.     SocketBase - Library base of bsdsocket.library
  372.  
  373.    NOTE
  374.     You need to open miami.library V6 or higher and bsdsocket.library V4
  375.     or higher before calling this function.  Mind the version numbers !
  376.     Using miamipcap.library with older library versions will cause
  377.     crashes.
  378.  
  379. MiamiPCapIsSwapped                       MiamiPCapIsSwapped
  380.  
  381.    NAME
  382.     MiamiPCapIsSwapped -- check byte order of save file
  383.  
  384.    SYNOPSIS
  385.     bool = MiamiPCapIsSwapped( p  );
  386.     D0               A0
  387.  
  388.     int MiamiPCapIsSwapped( pcap_t *p );
  389.  
  390.    FUNCTION
  391.     returns TRUE if the save file for this pcap unit uses a different
  392.     byte order than the current system, and FALSE if the byte order is
  393.     the same.
  394.  
  395.    INPUTS
  396.     p - pcap unit handle
  397.  
  398.    RESULT
  399.     bool (D0) - bool
  400.  
  401. MiamiPCapLookupdev                       MiamiPCapLookupdev
  402.  
  403.    NAME
  404.     MiamiPCapLookupdev -- finds a suitable interface name
  405.  
  406.    SYNOPSIS
  407.     name = MiamiPCapLookupdev( ebuf );
  408.     D0               A0
  409.  
  410.     char *MiamiPCapLookupdev( char *ebuf );
  411.  
  412.    FUNCTION
  413.     Finds a suitable interface name for use with MiamiPCap, that can be
  414.     used as a default name if the user has not explicitly specified an
  415.     interface.
  416.  
  417.     A NULL return value indicates that an error has occured.  If the
  418.     return value is non-NULL, then it is a pointer to a valid interface
  419.     name in static storage, i.e.  the pointer does not have to be freed,
  420.     but the name will be overwritten by future calls to
  421.     MiamiPCapLookupdev.
  422.  
  423.    INPUTS
  424.     ebuf - buffer for error string
  425.  
  426.    RESULT
  427.     name (D0) - interface name
  428.  
  429. MiamiPCapLookupnet                       MiamiPCapLookupnet
  430.  
  431.    NAME
  432.     MiamiPCapLookupnet -- finds the interface address and netmask
  433.  
  434.    SYNOPSIS
  435.     error = MiamiPCapLookupnet( device, netp, maskp, ebuf );
  436.     D0                A0        A1      A2     A3
  437.  
  438.     int MiamiPCapLookupnet( char *device, bpf_u_int32 *netp, bpf_u_int32
  439.         *maskp, char *ebuf );
  440.  
  441.    FUNCTION
  442.     Finds the interface (IP) address and the netmask for the specified
  443.     interface.
  444.  
  445.     The return code is zero for success and non-zero for failure, in
  446.     which case the error buffer will contain an error message.
  447.  
  448.     The pointers netp and maskp need to point to variables of type
  449.     bpf_u_int32, which will be filled with the IP address and netmask of
  450.     the specified interface, respectively.
  451.  
  452.    INPUTS
  453.     device - interface name
  454.  
  455.     netp - pointer to address
  456.  
  457.     maskp - pointer to netmask
  458.  
  459.     ebuf - buffer for error string
  460.  
  461.    RESULT
  462.     error (D0) - error code
  463.  
  464. MiamiPCapLoop                            MiamiPCapLoop
  465.  
  466.    NAME
  467.     MiamiPCapLoop -- loop to collect and process packets
  468.  
  469.    SYNOPSIS
  470.     count = MiamiPCapLoop( p, cnt, callback, user );
  471.     D0               A0 D0   A1     A2
  472.  
  473.     int MiamiPCapLoop( pcap_t *p, int cnt, pcap_handler callback, u_char
  474.         *user );
  475.  
  476.    FUNCTION
  477.     Same as MiamiPCapDispatch, but with one difference:
  478.  
  479.     MiamiPCapDispatch returns as soon as some packets have been read (or
  480.     another condition such as a timeout or an error has occured).
  481.     MiamiPCapLoop keeps reading until cnt packets have been read or an
  482.     error has occured.
  483.  
  484.    INPUTS
  485.     p - pcap unit handle
  486.  
  487.     cnt - number of packets
  488.  
  489.     callback - packet callback
  490.  
  491.     user - user data for callback
  492.  
  493.    RESULT
  494.     count (D0) - packet count
  495.  
  496. MiamiPCapMajorVersion                    MiamiPCapMajorVersion
  497.  
  498.    NAME
  499.     MiamiPCapMajorVersion -- return major version number for save file
  500.  
  501.    SYNOPSIS
  502.     version = MiamiPCapMajorVersion( p  );
  503.     D0                 A0
  504.  
  505.     int MiamiPCapMajorVersion( pcap_t *p );
  506.  
  507.    FUNCTION
  508.     returns the major version number of the pcap used to write the save
  509.     file.
  510.  
  511.    INPUTS
  512.     p - pcap unit handle
  513.  
  514.    RESULT
  515.     version (D0) - version
  516.  
  517. MiamiPCapMinorVersion                    MiamiPCapMinorVersion
  518.  
  519.    NAME
  520.     MiamiPCapMinorVersion -- return minor version number for save file
  521.  
  522.    SYNOPSIS
  523.     version = MiamiPCapMinorVersion( p  );
  524.     D0                 A0
  525.  
  526.     int MiamiPCapMinorVersion( pcap_t *p );
  527.  
  528.    FUNCTION
  529.     returns the minor version number of the pcap used to write the save
  530.     file.
  531.  
  532.    INPUTS
  533.     p - pcap unit handle
  534.  
  535.    RESULT
  536.     version (D0) - version
  537.  
  538. MiamiPCapNext                            MiamiPCapNext
  539.  
  540.    NAME
  541.     MiamiPCapNext -- read one packet
  542.  
  543.    SYNOPSIS
  544.     packet = MiamiPCapNext( p, h  );
  545.     D0            A0 A1
  546.  
  547.     u_char *MiamiPCapNext( pcap_t *p, struct pcap_pkthdr *h );
  548.  
  549.    FUNCTION
  550.     Similar to MiamiPCapDispatch, but reads only a single packet and
  551.     returns the pointer to the packet data.  No callback function is
  552.     called.  The specified packet header is used as a template when
  553.     reading the packet.
  554.  
  555.    INPUTS
  556.     p - pcap unit handle
  557.  
  558.     h - packet header
  559.  
  560.    RESULT
  561.     packet (D0) - packet data
  562.  
  563. MiamiPCapOpenLive                        MiamiPCapOpenLive
  564.  
  565.    NAME
  566.     MiamiPCapOpenLive -- open a live pcap unit
  567.  
  568.    SYNOPSIS
  569.     p  = MiamiPCapOpenLive( device, snaplen, promisc, toms, ebuf );
  570.     D0            A0    D0     D1      D2    A1
  571.  
  572.     pcap_t *MiamiPCapOpenLive( char *device, int snaplen, int promisc,
  573.         int toms, char *ebuf );
  574.  
  575.    FUNCTION
  576.     Opens a live PCap monitoring unit, for the specified interface.
  577.  
  578.     A return value of NULL indicates that an error has occured, in which
  579.     case the buffer bassed in ebuf will contain an ASCII error message.
  580.  
  581.     snaplen is the maximum packet size you want PCap to preserve.
  582.     promisc is a boolean variable indicating promiscuous mode and
  583.     currently MUST be zero.  Promiscuous mode is not currently supported
  584.     because of limitations in the Amiga SANA-II standard.
  585.  
  586.     If toms is a non-zero value then it is considered a read timeout in
  587.     milliseconds for later calls to the packet monitoring functions.  A
  588.     value of zero means 'no timeout', i.e.    wait indefinitely.
  589.  
  590.     The error string buffer passed to MiamiPCapOpenLive is used not only
  591.     for this single function call, but for ALL error strings resulting
  592.     from future function calls for this pcap unit.
  593.  
  594.    INPUTS
  595.     device - interface name
  596.  
  597.     snaplen - maximum packet length to copy
  598.  
  599.     promisc - promisc mode, currently MUST be zero
  600.  
  601.     toms - timeout in milliseconds
  602.  
  603.     ebuf - buffer for error string
  604.  
  605.    RESULT
  606.     p (D0) - pcap unit handle
  607.  
  608. MiamiPCapOpenOffline                     MiamiPCapOpenOffline
  609.  
  610.    NAME
  611.     MiamiPCapOpenOffline -- open a savefile for reading
  612.  
  613.    SYNOPSIS
  614.     p  = MiamiPCapOpenOffline( fname, ebuf );
  615.     D0               A0      A1
  616.  
  617.     pcap_t *MiamiPCapOpenOffline( char *fname, char *ebuf );
  618.  
  619.    FUNCTION
  620.     Opens an offline PCap monitoring unit.    Packets are read from the
  621.     specified file, not from the network.  The file must have been
  622.     created by MiamiPCap earlier.
  623.  
  624.     A return value of NULL indicates that an error has occured, in which
  625.     case the buffer bassed in ebuf will contain an ASCII error message.
  626.  
  627.     The error string buffer passed to MiamiPCapOpenLive is used not only
  628.     for this single function call, but for ALL error strings resulting
  629.     from future function calls for this pcap unit.
  630.  
  631.    INPUTS
  632.     fname - file name
  633.  
  634.     ebuf - buffer for error string
  635.  
  636.    RESULT
  637.     p (D0) - pcap unit handle
  638.  
  639. MiamiPCapPerror                           MiamiPCapPerror
  640.  
  641.    NAME
  642.     MiamiPCapPerror -- prints the current pcap error string to the
  643.     console
  644.  
  645.    SYNOPSIS
  646.     MiamiPCapPerror( p, prefix );
  647.              A0 A1
  648.  
  649.     void MiamiPCapPerror( pcap_t *p, char *prefix );
  650.  
  651.    FUNCTION
  652.     Prints the current pcap error string to the console, in the same
  653.     format used by the Un*x perror() function call.
  654.  
  655.    INPUTS
  656.     p - pcap unit handle
  657.  
  658.     prefix - error prefix
  659.  
  660. MiamiPCapSetfilter                       MiamiPCapSetfilter
  661.  
  662.    NAME
  663.     MiamiPCapSetfilter -- attach a program to a pcap unit as a filter
  664.  
  665.    SYNOPSIS
  666.     error = MiamiPCapSetfilter( p, prog );
  667.     D0                A0 A1
  668.  
  669.     int MiamiPCapSetfilter( pcap_t *p, struct bpf_program *prog );
  670.  
  671.    FUNCTION
  672.     Ataches a compiled program to the specified pcap unit as a filter.
  673.     The program has to be a valid BPF program, typically returned by a
  674.     previous call to MiamiPCapCompile.  The new filter replaces the
  675.     previous filter (if any).
  676.  
  677.     A return code of zero indicates success, a non-zero return code
  678.     indicates failure.
  679.  
  680.    INPUTS
  681.     p - pcap unit handle
  682.  
  683.     prog - compiled program
  684.  
  685.    RESULT
  686.     error (D0) - error code
  687.  
  688. MiamiPCapSnapshot                        MiamiPCapSnapshot
  689.  
  690.    NAME
  691.     MiamiPCapSnapshot -- return the maximum snapshot length
  692.  
  693.    SYNOPSIS
  694.     len = MiamiPCapSnapshot( p  );
  695.     D0             A0
  696.  
  697.     int MiamiPCapSnapshot( pcap_t *p );
  698.  
  699.    FUNCTION
  700.     returns the maximum packet length used for snapshot (i.e.  the value
  701.     passed in the snaplen parameter to MiamiPCapOpenLive.
  702.  
  703.    INPUTS
  704.     p - pcap unit handle
  705.  
  706.    RESULT
  707.     len (D0) - length
  708.  
  709. MiamiPCapStats                               MiamiPCapStats
  710.  
  711.    NAME
  712.     MiamiPCapStats -- return packet statistics
  713.  
  714.    SYNOPSIS
  715.     error = MiamiPCapStats( p, st );
  716.     D0            A0 A1
  717.  
  718.     int MiamiPCapStats( pcap_t *p, pcap_stat *st );
  719.  
  720.    FUNCTION
  721.     Returns statistics for the specified pcap unit handle, by
  722.  
  723.    filling
  724.     in the statistics structure passed to the function.
  725.  
  726.     If the returned error code is 0 then the contents of the statistics
  727.     structure are valid.
  728.  
  729.    INPUTS
  730.     p - pcap unit handle
  731.  
  732.     st - statistics
  733.  
  734.    RESULT
  735.     error (D0) - error code
  736.  
  737. MiamiPCapStrerror                        MiamiPCapStrerror
  738.  
  739.    NAME
  740.     MiamiPCapStrerror -- converts an error number to an error string
  741.  
  742.    SYNOPSIS
  743.     errstr = MiamiPCapStrerror( errnum );
  744.     D0                D0
  745.  
  746.     char *MiamiPCapStrerror( int errnum );
  747.  
  748.    FUNCTION
  749.     Converts an error number into an error string.    The returned pointer
  750.     points to static storage and does not have to be freed.  It is
  751.     overwritten with the next call to MiamiPCapStrerror.
  752.  
  753.     The returned pointer is independent of pcap units and NOT identical
  754.     to the error string buffer for any particular pcap unit.
  755.  
  756.    INPUTS
  757.     errnum - error number
  758.  
  759.    RESULT
  760.     errstr (D0) - error string
  761.  
  762.